<!DOCTYPE html>
<html lang="zh-CN">
@include('index.head')
<style>
    th{
        text-align: center;
    }
    tr{
        text-align: center;
    }
</style>
<body>
@include('index.topNav')
@if(session('__Ajax_RedirectFunc_status') == true)
    <div>
        <div class="alert alert-success alert-dismissible fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h3>成功</h3>
            <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
            <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
        </div>
    </div>
@endif
@if(session('__Ajax_RedirectFunc_status') === false)
    <div >
        <div class="alert alert-danger alert-dismissible fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <h3>失败</h3>
            <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
            <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
        </div>
    </div>
@endif
<div class="container">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-body">
                <h2>我的订单</h2>
                <hr>
                <table class="table table-responsive table-condensed table-hover table-striped">
                    <thead>
                    <tr>
                        <th>订单时间</th>
                        <th>订单编号</th>
                        <th>店铺</th>
                        <th>订单类型</th>
                        <th>单价</th>
                        <th>数量</th>
                        <th>备注</th>
                        <th>应收金额</th>
                        <th>订单状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($taskData as $data)
                        <tr>
                            <td>{{$data->task_time}}</td>
                            <td>
                                <?php
                                $ids = DB::table('accessory')->where('accessory_id',$data->task_id)->first();
                                echo substr($ids->accessory_address,'0','18');
                                ?>
                            </td>
                            <td><a href="/shop/{{$data->shop_id}}">{{$data->shop_name}}</a></td>
                            <td>{{$data->service_name}}</td>
                            <td>{{$data->service_price}} 元 / 张</td>
                            <td>{{$data->task_num}} 张</td>
                            <td>{{$data->task_info}}</td>
                            <td>{{$data->task_price}}元</td>
                            <td>{{$data->status_name}}</td>
                            <td>
                                @if($data->status_name == '制作完成，等待取货')
                                    <a href="/toEndTask/{{$ids->accessory_id}}" class="btn btn-sm btn-success">已取件</a>
                                @endif
                                @if($data->status_name != '制作完成，等待取货')
                                    <a href="javascript:;" class="btn btn-sm btn-success" disabled>已取件</a>
                                @endif
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>


</div> <!-- /container -->
</body>
</html>